#include <iostream>
#include <stack>
#include <map>

using namespace std;

void tenToTwo(int n)
{
    stack<int> s1;
    while (1)
    {
        s1.push(n % 2);
        n /= 2;
        if (n == 0)
            break;
    }

    while (!s1.empty())
    {
        cout << s1.top();
        s1.pop();
    }

    cout << endl;
}

void tenToEight(int n)
{
    stack<int> s2;

    while (1)
    {
        s2.push(n % 8);
        n /= 8;
        if (n == 0)
            break;
    }

    while (!s2.empty())
    {
        cout << s2.top();
        s2.pop();
    }

    cout << endl;
}

void tenToSixteen(int n)
{
    stack<int> s3;

    map<int, char> m1;
    m1.emplace(10, 'A');
    m1.emplace(11, 'B');
    m1.emplace(12, 'C');
    m1.emplace(13, 'D');
    m1.emplace(14, 'E');
    m1.emplace(15, 'F');

    while (1)
    {
        s3.push(n % 16);
        n /= 16;
        if (n == 0)
            break;
    }

    while (!s3.empty())
    {
        if (m1.find(s3.top()) != m1.end())
            cout << m1[s3.top()];
        else
            cout << s3.top();
        s3.pop();
    }
    cout << endl;
}

int main()
{

    int n = 110;

    tenToTwo(n);
    tenToEight(n);
    tenToSixteen(n);

    return 0;
}